package com.cloudbroker.openapi.mobile.controller;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMapForBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.reward.vo.BrokerIdForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.reward.vo.RewardInfoForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.reward.vo.RewardNumVo;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.system.back.PaymentOptionInfoForm;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.business.RewardT2BizService;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.business.SystemT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;
/**
 * Created by zhaojp18008 on 2016/5/9.
 */
@Controller
public class RewardController {
    @Resource
    private RewardT2BizService rewardT2BizService;
    @Resource
    private SystemT2BizService systemT2;
    /**
     * 打赏
     * */
    @ResponseBody
    @RequestMapping("/func_click_reward")
    @SaveLog(remark = "打赏")
    public RewardNumVo funcPayAmount(HttpServletRequest request , String jsonpcallback){
        RewardInfoForm RewardInfoForm = getSingleParameterMapForBody(request , RewardInfoForm.class);
        RewardNumVo hsbcpsBackVO = this.rewardT2BizService.funcClickReward(RewardInfoForm);
        return VOUtil.setJsonpResult(hsbcpsBackVO, jsonpcallback);
    }
    
    @ResponseBody
    @RequestMapping("/func_payment_option_qry")
    @SaveLog(remark = "查询打赏、充值额度")
    public PaymentOptionInfoForm funcPaymentOptionQry(HttpServletRequest request, String jsonpcallback) {
        BrokerIdForm form = getSingleParameterMapForBody(request, BrokerIdForm.class);
        return VOUtil.setJsonpResult(systemT2.funcPaymentOptionQry(form), jsonpcallback);
    }
}
